* ====================================
* Thürk/Klüver: Hitting the sweet spot? The electoral consequences of supporting minority governments
*
* Comparative Political Studies
*  
* Replication Do File (includes all code for Stata Analyses, for Panel Match Analyses, please check R files)
* ====================================

* set working directory
clear
cd "..." 
set more off
* open dataset
use "...\main_dataset_ThuerkKluever.dta", clear

* Inspect main Independent Variables: Party Status 
ssc install fre
*Status of party: 1-PM party; 2-Junior coalition member party; 3-Support of minority cabinet; 5-Opposition party 
fre status3
*Status2 of party: 1-PM party; 2-Junior coalition member party; 3-Declared support party; 4-Contract support party; 5-Opposition party 
fre status5

* Label control variables
label variable next_pervote "Vote share next"
label variable minority "Minority cabinet"
label variable s_conflict10 "Legislative coalition conflict"
label variable rile_extreme "Right-left extreme"
label variable rile_shift "Right-left shift"
label variable rile_shift_abs "Right-left shift abs."
label variable niche_party "Niche party"
label variable pervote "Vote share last"

*******************************************************
************* Main Models in Table 1 ******************
*******************************************************

*Model 1
regress next_pervote ib5.status3 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote if single_majority == 0, vce(cluster e_id)
estimates store m1
esttab m1, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain

*Model 2
regress next_pervote ib5.status5 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote if single_majority == 0, vce(cluster e_id)
estimates store m2
esttab m2, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain

*Model 3
regress next_pervote ib2.status3 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote if single_majority == 0, vce(cluster e_id)
estimates store m3
esttab m3, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain

*Model 4
regress next_pervote ib2.status5 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote if single_majority == 0, vce(cluster e_id)
estimates store m4
esttab m4, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain

* Results for Table 1
esttab m1 m2 m3 m4,  b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4") star(* 0.1 ** 0.05 *** 0.01)  parentheses 
esttab m1 m2 m3 m4 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4") star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace

********************************************************
***************** Begin Figure 1 ***********************
********************************************************
set scheme plottig

* Create and save the first graph with a custom legend
coefplot m1, levels(95 90) ///
xscale(lstyle(none)) ylabel(, nogrid) ///
legend(order(1 "Model 1") rows(1) pos(6) size(small) margin(small)) ///
drop(minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote _cons) ///
xline(0) ///
msymbol(square) msize(mediumlarge) ///
label(1 "Model 1")
graph save temp1.gph, replace

* Create and save the second graph with a custom legend
coefplot m2, levels(95 90) ///
xscale(lstyle(none)) ylabel(, nogrid) ///
legend(order(1 "Model 2") rows(1) pos(6) size(small) margin(small)) ///
drop(minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote _cons) ///
xline(0) ///
msymbol(X) msize(large) ///
label(1 "Model 2")
graph save temp2.gph, replace

* Combine the first and second graph
graph combine temp1.gph temp2.gph, ///
title("in comparison to opposition parties (Model 1 & 2)", size(medium) margin(mediumsmall)) ///
cols(1) xcommon
graph save combined1.gph, replace

* Create and save the third graph with a custom legend
coefplot m3, levels(95 90) ///
xscale(lstyle(none)) ylabel(, nogrid) ///
legend(order(1 "Model 3") rows(1) pos(6) size(small) margin(small)) ///
drop(minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote _cons) ///
xline(0) ///
msymbol(circle) msize(mediumlarge) ///
label(1 "Model 3")
graph save temp3.gph, replace

* Create and save the fourth graph with a custom legend
coefplot m4, levels(95 90) ///
xscale(lstyle(none)) ylabel(, nogrid) ///
legend(order(1 "Model 4") rows(1) pos(6) size(small) margin(small)) ///
drop(minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote _cons) ///
xline(0) ///
msymbol(diamond) msize(mediumlarge) ///
label(1 "Model 4")
graph save temp4.gph, replace

* Combine the third and fourth graph
graph combine temp3.gph temp4.gph, ///
title("in comparison to junior coalition partners (Model 3 & 4)", size(medium) margin(mediumsmall)) ///
cols(1) xcommon
graph save combined2.gph, replace

* Combine the two combined graphs
graph combine combined1.gph combined2.gph, ///
title("AMEs of a party's cabinet status on its subsequent vote share...", size(mediumlalarge) margin(medium)) ///
cols(2) xcommon
*******************************************************
**************** END OF Figure 1 **********************
*******************************************************

*==================================================================================================================
*==================================================================================================================

*******************************************************
****** 2-WAY-FE MODELS (table 7 in Appendix) **********
********* Base for results in Figure 2 ****************
***************** Models 17-28 ************************
*******************************************************
* ===================================
* ALL GOVERNMENTS, ALL ELECTIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior i.e_id i.party 
estat ic
estimates store ma1
esttab ma1,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support i.e_id i.party 
estat ic
estimates store ma2
esttab ma2,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of contract support of minority governments 
quietly regress next_pervote pervote treat_support_formal i.e_id i.party 
estat ic
estimates store ma3
esttab ma3,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_formal _cons)

* Effect of declared support of minority governments 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party 
estat ic
estimates store ma4
esttab ma4,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_subst _cons)

* ===================================
* NO SINGLE PARTY MAJORITY SITUATIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior i.e_id i.party if single_majority==0  
estat ic
estimates store m1
esttab m1,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support i.e_id i.party if single_majority==0  
estat ic
estimates store m2
esttab m2,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of contract support of minority governments 
quietly regress next_pervote pervote treat_support_formal i.e_id i.party if single_majority==0  
estat ic
estimates store m3
esttab m3,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_formal _cons)

* Effect of declared support of minority governments 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party if single_majority==0  
estat ic
estimates store m4
esttab m4,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_subst _cons)

* =================================
* MINORITY GOVERNMENTS ONLY
* =================================
* Effect of junior partnership in minority settings
quietly regress next_pervote pervote treat_junior i.e_id i.party if minority == 1 
estat ic
estimates store m9
esttab m9,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior _cons)

* Effect of support partnership in minority settings
quietly regress next_pervote pervote treat_support i.e_id i.party if minority == 1 
estat ic
estimates store m10
esttab m10,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of formal support in minority settings
quietly regress next_pervote pervote treat_support_formal i.e_id i.party if minority == 1 
estat ic
estimates store m11
esttab m11,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal _cons)

* Effect of substantive support in minority settings 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party if minority == 1 
estat ic
estimates store m12
esttab m12,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst _cons)

* TABLE 7, APPENDIX
esttab ma1 ma2 ma3 ma4 m1 m2 m3 m4 m9 m10 m11 m12,  b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE Results, main controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote _cons)
esttab ma1 ma2 ma3 ma4 m1 m2 m3 m4 m9 m10 m11 m12 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE Results, main controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote _cons) replace

********************************************************
***************** Begin Figure 2 ***********************
********************************************************
* Define the x-axis range
local xrange -4 6
set scheme plottig

* Label the variables
lab var treat_junior "Junior partner"
lab var treat_support "Support party"
lab var treat_support_formal "Contract support"
lab var treat_support_subst "Declared support"

* Create and save the first subgraph for "labels only" (trick Stata into making a nicer graph)
coefplot (ma1, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))) ///
         (ma2, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))) ///
         (ma3, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))) ///
         (ma4, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))), ///
         keep(treat*) ///
         title("") ///
         ytitle("") ///
         legend(off) ///
         xlabel(none) ///
         ylabel(, angle(0) noticks) ///
         plotregion(margin(zero) style(none)) ///
         graphregion(margin(zero) color(white)) ///
         xtitle("")
graph save all_graph1.gph, replace

* Create and save the first subgraph for "All"
coefplot (ma1, levels(95 90) lcolor(black) lpattern(solid) msymbol(circle) mcolor(gs5) msize(large)) ///
         (ma2, levels(95 90) lcolor(black) lpattern(solid) msymbol(diamond) mcolor(gs5) msize(large)) ///
         (ma3, levels(95 90) lcolor(black) lpattern(solid) msymbol(square) mcolor(gs5) msize(large)) ///
         (ma4, levels(95 90) lcolor(black) lpattern(solid) msymbol(triangle) mcolor(gs5) msize(large)), ///
         keep(treat*) xline(0, lcolor(red) lpattern(dash)) ///
         title("All cabinets") ///
         ytitle("") ///
         legend(off) ///
         xlabel(-6(2)2, grid) ///
		  ylabel("", noticks) ///
         plotregion(color(gs15)) ///
         graphregion(color(white))
graph save all_graph.gph, replace

* Create and save the second subgraph for "Coalition"
coefplot (m1, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(circle) mcolor(gs5) msize(large)) ///
         (m2, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(diamond) mcolor(gs5) msize(large)) ///
         (m3, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(square) mcolor(gs5) msize(large)) ///
         (m4, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(triangle) mcolor(gs5) msize(large)), ///
         keep(treat*) xline(0, lcolor(red) lpattern(dash)) ///
         title("Coalitions only") ///
         legend(off) ///
         xlabel(-6(2)2, grid) ///
          ylabel("", noticks) ///
         plotregion(color(gs15)) ///
         graphregion(color(white))
graph save coalition_graph.gph, replace

* Create and save the third subgraph for "Minority"
coefplot (m9, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(circle) mcolor(gs5) msize(large)) ///
         (m10, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(diamond) mcolor(gs5) msize(large)) ///
         (m11, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(square) mcolor(gs5) msize(large)) ///
         (m12, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(triangle) mcolor(gs5) msize(large)), ///
         keep(treat*) xline(0, lcolor(red) lpattern(dash)) ///
         title("Minority cabinets only") ///
         legend(off) ///
         ytitle("") ///
         xlabel(-6(2)2, grid) ///
          ylabel("", noticks) ///
         plotregion(color(gs15)) ///
         graphregion(color(white))
graph save minority_graph.gph, replace

* Combine the three subgraphs
graph combine all_graph1.gph all_graph.gph  coalition_graph.gph minority_graph.gph, ///
cols(4) xcommon

********************************************************
***************** End Figure 2 *************************
********************************************************

**========= FIGURE 3 (Panel Match analyis) in R File ========

*==================================================================================================================
*==================================================================================================================
**************************************ADDITIONAL ROBUSTNESS CHECKS ************************************************
*==================================================================================================================
*==================================================================================================================

********************************************************************************
****Table 4: OLS Models DV: Party Vote Share, Country Fixed Effects  ***********
********************************************************************************
*Model 5
regress next_pervote ib5.status3 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote i.country if single_majority == 0, vce(cluster e_id)
estimates store m5
esttab m5, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 6
regress next_pervote ib5.status5 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party pervote i.country if single_majority == 0, vce(cluster e_id)
estimates store m6
esttab m6, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 7
regress next_pervote ib2.status3 i.minority pervote s_conflict10 rile_extreme rile_shift rile_shift_abs i.niche_party i.country if single_majority == 0, vce(cluster e_id)
estimates store m7
esttab m7, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 8
regress next_pervote ib2.status5 i.minority pervote s_conflict10 rile_extreme rile_shift rile_shift_abs i.niche_party i.country if single_majority == 0, vce(cluster e_id)
estimates store m8
esttab m8, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain

* Results for Table 4 in Appendix
esttab m5 m6 m7 m8,  b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 5" "Model 6" "Model 7" "Model 8") star(* 0.1 ** 0.05 *** 0.01)  parentheses 
esttab m5 m6 m7 m8 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 5" "Model 6" "Model 7" "Model 8") star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace

********************************************************************************
****Table 5: OLS Models DV: Party Vote Gains, Reference: Opposition parties ****
********************************************************************************
*Model 9
regress vote_gains ib5.status3 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_vote_gains if single_majority == 0, vce(cluster e_id)
estimates store m9
esttab m9, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 10
regress vote_gains ib5.status5 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_vote_gains if single_majority == 0, vce(cluster e_id)
estimates store m10
esttab m10, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 11
regress vote_gains ib5.status3 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_vote_gains i.country if single_majority == 0, vce(cluster e_id)
estimates store m11
esttab m11, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 12
regress vote_gains ib5.status5 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_vote_gains i.country if single_majority == 0, vce(cluster e_id)
estimates store m12
esttab m12, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain

* Results for Table 5 in Appendix
esttab m9 m10 m11 m12,  b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 9" "Model 10" "Model 11" "Model 12") star(* 0.1 ** 0.05 *** 0.01)  parentheses 
esttab m9 m10 m11 m12 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 9" "Model 10" "Model 11" "Model 12") star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace

********************************************************************************
**Table 6: OLS Models DV: Relative Vote Share, Reference: Opposition parties ***
********************************************************************************
*Model 13
regress next_votes_rel ib5.status3 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_next_votes_rel if single_majority == 0, vce(cluster e_id)
estimates store m13
esttab m13, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 14
regress next_votes_rel ib5.status5 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_next_votes_rel if single_majority == 0, vce(cluster e_id)
estimates store m14
esttab m14, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 15
regress next_votes_rel ib5.status3 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_next_votes_rel i.country if single_majority == 0, vce(cluster e_id)
estimates store m15
esttab m15, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain
*Model 16
regress next_votes_rel ib5.status5 minority s_conflict10 rile_extreme rile_shift rile_shift_abs niche_party lag_next_votes_rel i.country if single_majority == 0, vce(cluster e_id)
estimates store m16
esttab m16, b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace plain

* Results for Table 6 in Appendix
esttab m13 m14 m15 m16,  b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 13" "Model 14" "Model 15" "Model 16") star(* 0.1 ** 0.05 *** 0.01)  parentheses 
esttab m13 m14 m15 m16 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(OLS Model Results) nonumbers mtitles("Model 13" "Model 14" "Model 15" "Model 16") star(* 0.1 ** 0.05 *** 0.01)  parentheses  replace

********************************************************************************
***********Table 8: Two-way FE models, full sample, all controls****************
********************************* MODELS 29-40 *********************************
********************************************************************************
* ===================================
* ALL GOVERNMENTS, ALL ELECTIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs s_conflict10  i.e_id i.party 
estat ic
estimates store mb1
esttab mb1,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party 
estat ic
estimates store mb2
esttab mb2,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs s_conflict10  _cons)

* Effect of contract support in minority governments 
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party 
estat ic
estimates store mb3
esttab mb3,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of declared support in minority governments 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party 
estat ic
estimates store mb4
esttab mb4,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* ===================================
* NO SINGLE PARTY MAJORITY SITUATIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs s_conflict10  i.e_id i.party if single_majority == 0
estat ic
estimates store mc1
esttab mc1,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs  s_conflict10 i.e_id i.party if single_majority == 0
estat ic
estimates store mc2
esttab mc2,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs s_conflict10  _cons)

* Effect of contract support in minority governments 
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10   i.e_id i.party  if single_majority == 0
estat ic
estimates store mc3
esttab mc3,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of declared support in minority governments 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10   i.e_id i.party  if single_majority == 0
estat ic
estimates store mc4
esttab mc4,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* ===================================
* MINORITY GOVERNMENTS ONLY
* ===================================
* Effect of junior partnership in minority settings
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  i.e_id i.party if minority == 1
estat ic
estimates store mb9
esttab mb9,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership in minority settings
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs s_conflict10   i.e_id i.party if minority == 1 
estat ic
estimates store mb10
esttab mb10,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of contract support in minority settings
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party if minority == 1
estat ic
estimates store mb11
esttab mb11,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* Effect of declared support in minority settings 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs  s_conflict10  i.e_id i.party if minority == 1 
estat ic
estimates store mb12
esttab mb12,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* All results for table 8
esttab mb1 mb2 mb3 mb4 mc1 mc2 mc3 mc4 mb9 mb10 mb11 mb12,  b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE Models, full controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition"  "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)
esttab mb1 mb2 mb3 mb4 mc1 mc2 mc3 mc4 mb9 mb10 mb11 mb12 using results_controls.tex, b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE Models, full controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote rile_extreme rile_shift rile_shift_abs s_conflict10   _cons) replace

********************************************************
***************** Begin Figure 7 (Appendix) ************
********************************************************
* Define the x-axis range
local xrange -4 6
set scheme plottig

* Label the variables
lab var treat_junior "Junior partner"
lab var treat_support "Support party"
lab var treat_support_formal "Contract support"
lab var treat_support_subst "Declared support"

* Create and save the first subgraph for "labels only" (trick Stata into making a nicer graph)
coefplot (mb1, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))) ///
         (mb2, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))) ///
         (mb3, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))) ///
         (mb4, lcolor(none) lpattern(none) msymbol(i) ciopts(recast(connected) lcolor(none) lpattern(none))), ///
         keep(treat*) ///
         title("") ///
         ytitle("") ///
         legend(off) ///
         xlabel(none) ///
         ylabel(, angle(0) noticks) ///
         plotregion(margin(zero) style(none)) ///
         graphregion(margin(zero) color(white)) ///
         xtitle("")
graph save all_graph1b.gph, replace

* Create and save the first subgraph for "All"
coefplot (mb1, levels(95 90) lcolor(black) lpattern(solid) msymbol(circle) mcolor(gs5) msize(large)) ///
         (mb2, levels(95 90) lcolor(black) lpattern(solid) msymbol(diamond) mcolor(gs5) msize(large)) ///
         (mb3, levels(95 90) lcolor(black) lpattern(solid) msymbol(square) mcolor(gs5) msize(large)) ///
         (mb4, levels(95 90) lcolor(black) lpattern(solid) msymbol(triangle) mcolor(gs5) msize(large)), ///
         keep(treat*) xline(0, lcolor(red) lpattern(dash)) ///
         title("All cabinets") ///
         ytitle("") ///
         legend(off) ///
         xlabel(-6(2)2, grid) ///
		  ylabel("", noticks) ///
         plotregion(color(gs15)) ///
         graphregion(color(white))
graph save all_graphb.gph, replace

* Create and save the second subgraph for "Coalition"
coefplot (mc1, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(circle) mcolor(gs5) msize(large)) ///
         (mc2, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(diamond) mcolor(gs5) msize(large)) ///
         (mc3, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(square) mcolor(gs5) msize(large)) ///
         (mc4, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(triangle) mcolor(gs5) msize(large)), ///
         keep(treat*) xline(0, lcolor(red) lpattern(dash)) ///
         title("Coalitions only") ///
         legend(off) ///
         xlabel(-6(2)2, grid) ///
          ylabel("", noticks) ///
         plotregion(color(gs15)) ///
         graphregion(color(white))
graph save coalition_graphb.gph, replace

* Create and save the third subgraph for "Minority"
coefplot (mb9, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(circle) mcolor(gs5) msize(large)) ///
         (mb10, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(diamond) mcolor(gs5) msize(large)) ///
         (mb11, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(square) mcolor(gs5) msize(large)) ///
         (mb12, levels(95 90) lcolor(gs5) lpattern(solid) msymbol(triangle) mcolor(gs5) msize(large)), ///
         keep(treat*) xline(0, lcolor(red) lpattern(dash)) ///
         title("Minority cabinets only") ///
         legend(off) ///
         ytitle("") ///
         xlabel(-6(2)2, grid) ///
          ylabel("", noticks) ///
         plotregion(color(gs15)) ///
         graphregion(color(white))
graph save minority_graphb.gph, replace

* Combine the subgraphs
graph combine all_graph1b.gph all_graphb.gph  coalition_graphb.gph minority_graphb.gph, ///
cols(4) xcommon

********************************************************
***************** End Figure 7 (Appendix) **************
********************************************************

********************************************************************************
*********Table 10: Two-way FE models, Enlarged sample, main controls************
********************************* MODELS 41-52 *********************************
********************************************************************************

***open data set for enlarged sample
use "...\enlarged_data_ThuerkKluever.dta", clear

* ===================================
* ALL GOVERNMENTS, ALL ELECTIONS
* =================================== 
********************* clustered by party-election identifier obs_id = group(e_id party)
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store md1
esttab md1,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store md2
esttab md2,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of contract support in minority governments 
quietly regress next_pervote pervote treat_support_formal i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store md3
esttab md3,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal _cons)

* Effect of declared support in minority governments 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store md4
esttab md4,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst _cons)

* ===================================
* NO SINGLE PARTY MAJORITY SITUATIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store md5
esttab md5,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior  _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store md6
esttab md6,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of contract support
quietly regress next_pervote pervote treat_support_formal i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store md7
esttab md7,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal _cons)

* Effect of declared support 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store md8
esttab md8,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst _cons)

* ===================================
* MINORITY GOVERNMENTS ONLY
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior i.e_id i.party if minority == 1, vce(cluster obs_id)
estat ic
estimates store md9
esttab md9,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior _cons)

* Effect of support partnership 
quietly regress next_pervote pervote treat_support i.e_id i.party if minority == 1, vce(cluster obs_id)
estat ic
estimates store md10
esttab md10,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of contract support 
quietly regress next_pervote pervote treat_support_formal i.e_id i.party if minority == 1, vce(cluster obs_id)
estat ic
estimates store md11
esttab md11,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal _cons)

* Effect of declared support 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party if minority == 1 , vce(cluster obs_id)
estat ic
estimates store md12
esttab md12,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst _cons)

* All results Table 10
esttab md1 md2 md3 md4 md5 md6 md7 md8 md9 md10 md11 md12,  b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, enlarged sample, main controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote _cons)
esttab md1 md2 md3 md4 md5 md6 md7 md8 md9 md10 md11 md12 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, enlarged sample, main controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote _cons) replace

********************************************************************************
*********Table 11: Two-way FE models, Enlarged sample, full controls************
********************************* MODELS 53-64 *********************************
********************************************************************************

* ===================================
* ALL GOVERNMENTS, ALL ELECTIONS
* =================================== 
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs s_conflict10  i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store me1
esttab me1,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store me2
esttab me2,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs s_conflict10  _cons)

* Effect of contract support 
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store me3
esttab me3,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of declared support 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party, vce(cluster obs_id)
estat ic
estimates store me4

esttab me4,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* ===================================
* NO SINGLE PARTY MAJORITY SITUATIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs s_conflict10  i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store me5
esttab me5,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store me6
esttab me6,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs s_conflict10  _cons)

* Effect of contract support 
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store me7
esttab me7,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of declared support 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party if single_majority == 0, vce(cluster obs_id)
estat ic
estimates store me8
esttab me8,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* ===================================
* MINORITY GOVERNMENTS ONLY
* ===================================
* Effect of junior partnership in minority settings
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  i.e_id i.party if minority == 1, vce(cluster obs_id)
estat ic
estimates store me9
esttab me9,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership in minority settings
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs s_conflict10   i.e_id i.party if minority == 1 , vce(cluster obs_id)
estat ic
estimates store me10
esttab me10,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of contract support in minority settings
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs   s_conflict10 i.e_id i.party if minority == 1 , vce(cluster obs_id)
estat ic
estimates store me11
esttab me11,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* Effect of declared support in minority settings 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs  s_conflict10  i.e_id i.party if minority == 1 , vce(cluster obs_id)
estat ic
estimates store me12
esttab me12,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* All results for table 11
esttab me1 me2 me3 me4 me5 me6 me7 me8 me9 me10 me11 me12,  b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, enlarged sample, full controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)
esttab me1 me2 me3 me4 me5 me6 me7 me8 me9 me10 me11 me12 using results_controls.tex, b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, enlarged sample, full controls) nonumbers mtitles("All" "All" "All" "All" "Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote rile_extreme rile_shift rile_shift_abs s_conflict10   _cons) replace


********************************************************************************
*********Table 13: Two-way FE models, Scandinavia only, main controls***********
********************************* MODELS 65-72 *********************************
********************************************************************************
***open main data set for analysis of Scandinavian data only
use "...\main_dataset_ThuerkKluever.dta", clear

* ===================================
* NO SINGLE PARTY MAJORITY SITUATIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior i.e_id i.party if single_majority==0 & country<14 
estat ic
estimates store ms1
esttab ms1,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support i.e_id i.party if single_majority==0  & country<14 
estat ic
estimates store ms2
esttab ms2,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of contract support in minority governments 
quietly regress next_pervote pervote treat_support_formal i.e_id i.party if single_majority==0  & country<14 
estat ic
estimates store ms3
esttab ms3,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_formal _cons)

* Effect of declared support in minority governments 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party if single_majority==0  & country<14 
estat ic
estimates store ms4
esttab ms4,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01) parentheses keep (treat_support_subst _cons)

* ===================================
* MINORITY GOVERNMENTS ONLY
* ===================================
* Effect of junior partnership in minority settings
quietly regress next_pervote pervote treat_junior i.e_id i.party if minority == 1 & country<14 
estat ic
estimates store ms5
esttab ms5,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior _cons)

* Effect of support partnership in minority settings
quietly regress next_pervote pervote treat_support i.e_id i.party if minority == 1 & country<14 
estat ic
estimates store ms6
esttab ms6,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support _cons)

* Effect of contract support in minority settings
quietly regress next_pervote pervote treat_support_formal i.e_id i.party if minority == 1 & country<14 
estat ic
estimates store ms7
esttab ms7,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal _cons)

* Effect of declared support in minority settings 
quietly regress next_pervote pervote treat_support_subst i.e_id i.party if minority == 1 & country<14 
estat ic
estimates store ms8
esttab ms8,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst _cons)

* All results table 13
esttab ms1 ms2 ms3 ms4 ms5 ms6 ms7 ms8,  b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, Scandinavia only, main controls) nonumbers mtitles("Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote _cons)
esttab ms1 ms2 ms3 ms4 ms5 ms6 ms7 ms8 using results.tex, b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, Scandinavia only, main controls) nonumbers mtitles("Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote _cons) replace

********************************************************************************
*********Table 14: Two-way FE models, Scandinavia only, full controls***********
********************************* MODELS 73-80 *********************************
********************************************************************************

* ===================================
* NO SINGLE PARTY MAJORITY SITUATIONS
* ===================================
* Effect of junior partnership
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  i.e_id i.party if single_majority == 0 & country<14 
estat ic
estimates store ms9
esttab ms9,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs  s_conflict10 i.e_id i.party if single_majority == 0 & country<14 
estat ic
estimates store ms10
esttab ms10,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs s_conflict10  _cons)

* Effect of contract support in minority governments 
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10   i.e_id i.party  if single_majority == 0 & country<14 
estat ic
estimates store ms11
esttab ms11,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of declared support in minority governments 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10   i.e_id i.party  if single_majority == 0 & country<14 
estat ic
estimates store ms12
esttab ms12,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* ===================================
* MINORITY GOVERNMENTS ONLY
* ===================================
* Effect of junior partnership in minority settings
quietly regress next_pervote pervote treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  i.e_id i.party if minority == 1 & country<14 
estat ic
estimates store ms13
esttab ms13,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_junior rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of support partnership in minority settings
quietly regress next_pervote pervote treat_support rile_extreme rile_shift rile_shift_abs s_conflict10   i.e_id i.party if minority == 1  & country<14 
estat ic
estimates store ms14
esttab ms14,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* Effect of contract support in minority settings
quietly regress next_pervote pervote treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10 i.e_id i.party if minority == 1 & country<14 
estat ic
estimates store ms15
esttab ms15,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_formal rile_extreme rile_shift rile_shift_abs s_conflict10   _cons)

* Effect of declared support in minority settings 
quietly regress next_pervote pervote treat_support_subst rile_extreme rile_shift rile_shift_abs  s_conflict10  i.e_id i.party if minority == 1  & country<14 
estat ic
estimates store ms16
esttab ms16,  b(%9.3f) se(%9.3f) r2(2) label star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat_support_subst rile_extreme rile_shift rile_shift_abs  s_conflict10  _cons)

* All results table 14
esttab ms9 ms10 ms11 ms12 ms13 ms14 ms15 ms16,  b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, Scandinavia only, full controls) nonumbers mtitles("Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote rile_extreme rile_shift rile_shift_abs s_conflict10 _cons)
esttab ms9 ms10 ms11 ms12 ms13 ms14 ms15 ms16 using results_controls.tex, b(%9.3f) se(%9.3f) r2(2) label title(Two-way FE, Scandinavia only, full controls) nonumbers mtitles("Coalition" "Coalition" "Coalition" "Coalition" "Minority" "Minority" "Minority" "Minority") star(* 0.1 ** 0.05 *** 0.01)  parentheses keep (treat* pervote rile_extreme rile_shift rile_shift_abs s_conflict10 _cons) replace
